using System;
using System.Data;
using System.Linq;
using System.ComponentModel;
using System.Reflection;
using System.Collections.Generic;
using DataObject.Model;
using DataObject.Database;

public partial class ReservationServiceMapper
{
    #region ToEntity

    public static ReservationService ToEntity(ReservationService entity, ReservationServiceDTO businessobject)
    {
        if (businessobject == null)
        {
            return null;
        }
        entity.Active = businessobject.Active;
        entity.Unit = businessobject.Unit;
        entity.UnitPrice = businessobject.UnitPrice;
        entity.Currency = businessobject.Currency;
        entity.Date = businessobject.Date;
        entity.HotelPickupAddress = businessobject.HotelPickupAddress;
        entity.NightFlag = businessobject.NightFlag;
        entity.NumInPackage = businessobject.NumInPackage;
        entity.Nights = businessobject.Nights;
        entity.PackagePrice = businessobject.PackagePrice;
        entity.Pax = businessobject.Pax;
        entity.Program = businessobject.Program;
        entity.ProviderID = businessobject.ProviderID;
        entity.Rate = businessobject.Rate;
        entity.ReservationID = businessobject.ReservationID;
        entity.ReservationServiceID = businessobject.ReservationServiceID;
        entity.ServiceID = businessobject.ServiceID;
        entity.ServiceType = businessobject.ServiceType;
        entity.OtherUom = businessobject.OtherUom;
        entity.Amount = businessobject.Amount;
        entity.Status = businessobject.Status;
        return entity;
    }

    #endregion

    #region ToBusinessObject

    public static ReservationServiceDTO ToBusinessObject(ReservationService entity)
    {
        if (entity == null)
        {
            return null;
        }
        return new ReservationServiceDTO
        {
            Active = entity.Active,
            Unit = entity.Unit,
            UnitPrice = entity.UnitPrice,
            Currency = entity.Currency,
            Date = entity.Date,
            HotelPickupAddress = entity.HotelPickupAddress,
            NightFlag = entity.NightFlag,
            NumInPackage = entity.NumInPackage,
            Nights = entity.Nights,
            PackagePrice = entity.PackagePrice,
            Pax = entity.Pax,
            Program = entity.Program,
            ProviderID = entity.ProviderID,
            Rate = entity.Rate,
            ReservationID = entity.ReservationID,
            ReservationServiceID = entity.ReservationServiceID,
            ServiceID = entity.ServiceID,
            ServiceType = entity.ServiceType,
            OtherUom = entity.OtherUom,
            Amount = entity.Amount,
            Status = entity.Status,
            Provider = ProviderMapper.ToBusinessObject(entity.ProviderEntity),
            Reservation = ReservationMapper.ToBusinessObject(entity.Reservation),
            Service = ServiceMapper.ToBusinessObject(entity.Service)
        };
    }

    #endregion

    #region ToBusinessObjectHasChildren

    public static ReservationServiceDTO ToBusinessObjectHasChildren(ReservationService entity, params Type[] types)
    {
        if (entity == null)
        {
            return null;
        }
        ReservationServiceDTO businessobject = new ReservationServiceDTO
        {
            Active = entity.Active,
            Unit = entity.Unit,
            UnitPrice = entity.UnitPrice,
            Currency = entity.Currency,
            Date = entity.Date,
            HotelPickupAddress = entity.HotelPickupAddress,
            NightFlag = entity.NightFlag,
            NumInPackage = entity.NumInPackage,
            Nights = entity.Nights,
            PackagePrice = entity.PackagePrice,
            Pax = entity.Pax,
            Program = entity.Program,
            ProviderID = entity.ProviderID,
            Rate = entity.Rate,
            ReservationID = entity.ReservationID,
            ReservationServiceID = entity.ReservationServiceID,
            ServiceID = entity.ServiceID,
            ServiceType = entity.ServiceType,
            OtherUom = entity.OtherUom,
            Amount = entity.Amount,
            Status = entity.Status,
            Provider = ProviderMapper.ToBusinessObject(entity.ProviderEntity),
            Reservation = ReservationMapper.ToBusinessObject(entity.Reservation),
            Service = ServiceMapper.ToBusinessObject(entity.Service)
        };
        return businessobject;
    }

    #endregion

}
